﻿using StudentManage.ViewModels.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StudentManage.ViewModels.UControls
{
    public class ToolBarViewModel : ViewModelBase
    {
        public ToolBarViewModel() { }

        private RelayCommand addCmd;
        /// <summary>
        /// 新增命令
        /// </summary>
        public RelayCommand AddCmd
        {
            get { return addCmd; }
            set
            {
                addCmd = value;
                //OnPropertyChanged();
            }
        }

        private RelayCommand editCmd;
        /// <summary>
        /// 修改命令
        /// </summary>
        public RelayCommand EditCmd
        {
            get { return editCmd; }
            set
            {
                editCmd = value;
                //OnPropertyChanged();
            }
        }

        private RelayCommand infoCmd;
        /// <summary>
        /// 查看命令
        /// </summary>
        public RelayCommand InfoCmd
        {
            get { return infoCmd; }
            set
            {
                infoCmd = value;
                //OnPropertyChanged();
            }
        }

        private RelayCommand delCmd;
        /// <summary>
        /// 删除命令
        /// </summary>
        public RelayCommand DelCmd
        {
            get { return delCmd; }
            set
            {
                delCmd = value;
                //OnPropertyChanged();
            }
        }

        private RelayCommand recoverCmd;
        /// <summary>
        /// 恢复命令
        /// </summary>
        public RelayCommand RecoverCmd
        {
            get { return recoverCmd; }
            set
            {
                recoverCmd = value;
                //OnPropertyChanged();
            }
        }

        private RelayCommand removeCmd;
        /// <summary>
        /// 移除命令
        /// </summary>
        public RelayCommand RemoveCmd
        {
            get { return removeCmd; }
            set
            {
                removeCmd = value;
                //OnPropertyChanged();
            }
        }

        public void OnCanExecuted()
        {
            this.AddCmd.OnCanExecuteChanged();
            this.EditCmd.OnCanExecuteChanged();
            this.InfoCmd.OnCanExecuteChanged();
            this.DelCmd.OnCanExecuteChanged();
            this.RecoverCmd.OnCanExecuteChanged();
            this.RemoveCmd.OnCanExecuteChanged();
        }
    }
}
